package game.ui.controls
{
	import com.greensock.*;
	import game.ui.core.*;
	
	public class RxDialogBase extends RxUIElement
	{
		private var m_autoCloseTimer:Number;
		private var m_buttonLabels:Array;
		private var m_defaultButtonIndex:int;
		private var m_dialogManagerType:int = -1;
		protected var m_buttonClickCallback:Function;
		protected var m_buttonContainer:RxUIElementContainer;
		private static const ANIMATION_DURATION:Number = 0.3;
		
		public function RxDialogBase()
		{
		}
		
		public function Hide(param1:Boolean = true) : void
		{
			if (param1)
			{
				TweenLite.to(this, ANIMATION_DURATION, {alpha:0, onComplete:this.OnHideAnimationComplete});
			}
			else
			{
				this.OnHideAnimationComplete();
			}
			RemoveFromUpdateQueue();
		}
		
		protected function OnHideAnimationComplete() : void
		{
			RemoveFromLayer();
			if (stage && parent)
			{
				parent.removeChild(this);
			}
		}
	}
}